package com.logic.idevice.impl.di

import android.os.Build
import com.logic.idevice.IUHFSetting
import com.logic.idevice.impl.common.CommonSetting
import com.logic.idevice.impl.dt51.DT51Setting
import com.logic.idevice.impl.kjd.KjdSetting
import com.logic.idevice.impl.kv7.Kv7Setting
import com.sinopec.basemodule.base.BaseActivity
import me.iso88591.uhfg.common.k71v1_64_bsp

object SettingsDi {

    //根据不同设备创建对应的 设置
    fun inject(
        activity: BaseActivity<*>,
        pow: (Int) -> Unit,
        temp: (String) -> Unit,
    ): IUHFSetting {
        return if (Build.MODEL == k71v1_64_bsp) {
            Kv7Setting({ aBoolean: Boolean ->
                if (aBoolean) {
                    activity.showProgress()
                } else {
                    activity.dismissProgress()
                }
                Unit
            }, pow, temp)
        }else if (Build.MODEL == "KJD3.7(A)") {
            KjdSetting(pow, temp)
        }else if (Build.MODEL == "DT51") {
            DT51Setting(pow, temp)
        } else {
            CommonSetting(pow, temp)
        }
    }

}